#!/bin/bash

/services/verif_ativos.sh | sed s/'64.*('// | sed s/'):.*'// > /tmp/$$

lines=`wc -l < /tmp/$$`
head=`expr $lines - 4`
tail=`expr $head - 1`

cat /tmp/$$ | head -n $head | tail -n $tail > hostfile

if [ ! -z $1 ]; then
        cat hostfile | head -n $1 > /tmp/$$
        cp /tmp/$$ hostfile
fi

